import request from '@/common/js/request.js'
import {  channelRequestHeadFun } from '@/common/js/util'
const tenantId = 'gysk'
const SERVER_URL = '/api/agent/agent/agent-web'

export default {
	uploadImage (data) {
		let { headData, aesData } = channelRequestHeadFun(true, data)
		return request({
			url: `/v1/api/third-party/image/uploadImage`,
			method: 'post',
			data: { channelRequestHead: headData, requestBody: {data: aesData} }
		})
	},
	// 影像上传
	postUploadImageData(imgData) {
		imgData.tenantId = tenantId
		let { headData, aesData } = channelRequestHeadFun(false, imgData)
		return request({
			url: `${SERVER_URL}/v1/api/third-party/image/uploadImage`,
			method: 'post',
			data: { channelRequestHead: headData, requestBody: {data:imgData} }
		})
	},
	// 更新影响
	postUpdateImageData(imgData) {
		imgData.tenantId = tenantId
		let { headData, aesData } = channelRequestHeadFun(false, imgData)
		return request({
			url: `${SERVER_URL}/v1/api/third-party/image/updateImage`,
			method: 'post',
			data: { channelRequestHead: headData, requestBody: {data: imgData }}
		})
	},
	// 字段查询
	postQueryBySysDictNos(data) {
		let { headData, aesData } = channelRequestHeadFun(true, data)
		return request({
			url: `${SERVER_URL}/v1/api/backend/sysDict/queryBySysDictNos`,
			method: 'post',
			data: { channelRequestHead: headData, requestBody: {data: aesData} }
		})
	},
}
